<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta charset="UTF-8">
    <title>往期活动详情页</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="css/base.css">
    <script type="text/javascript" src="lib/js/evm.js"></script>
    <script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="lib/js/key.js"></script>
    <script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/model.js"></script>
    <style>
        #img1 {
            width: 702px;
            height: 482px;
            position: fixed;
            top: 159px;
            left: 60px;
        }
        
        .theoretical-bg>div {
            position: absolute;
            box-sizing: border-box;
            border: 3px solid transparent;
        }
        
        .theoretical-bg {
            width: 1280px;
            height: 720px;
            position: relative;
            top: 0;
            left: 0;
            background: url(../images/0_slices/32132.png) no-repeat left top;
        }
        
        .container {
            position: fixed;
            top: 360px;
            left: 782px;
            width: 438px;
            height: 483px;
            font-size: 24px;
            position: relative;
            overflow: hidden;
            border-radius: 10px;
            word-wrap: break-word;
            text-align: left;
            padding: 20px;
            font-family: Source Han Sans CN;
            font-weight: 300;
        }
        
        .content {
            width: 100%;
            border-radius: 10px;
        }
        
        .imgs {
            display: block;
            width: 100%;
            height: 100%;
        }
        
        #white-bg {
            position: absolute;
            top: 158px;
            left: 782px;
            width: 438px;
            height: 483px;
            background: rgba(155, 83, 11, 0.7);
            opacity: 0.16;
            border-radius: 8px;
        }
        
        .people {
            width: 96px;
            height: 32px;
            font-size: 27px;
            font-family: Noto Sans S Chinese;
            font-weight: 400;
            line-height: 54px;
            color: rgba(51, 51, 51, 1);
            opacity: 1;
            top: 185px;
            left: 800px;
        }
        
        .datatime {
            font-size: 20px;
            font-weight: 400;
            line-height: 41px;
            color: rgba(102, 102, 102, 1);
            opacity: 1;
            top: 233px;
            left: 803px;
        }
    </style>
</head>

<body>
    <div class="theoretical-bg" id="theoreticalMain">
        <div id="white-bg"></div>
        <div class="model" id="img1">
            <img class="imgs" src="" alt="">
        </div>




        <div class="container" id="container">
            <div class="content" id="content">

            </div>
        </div>

        <div class="people"></div>
        <div class="datatime"></div>

    </div>
    </div>
</body>
<script>
    var modelIndex = {
        disUser: true,
        specialState: 'didi',
        index: 2, //初始位置
        listName: 'model', //模块名称
        containerId: 'theoreticalMain', //包含模块的标签id
        thisContain: 'container', //翻滚外容器
        thisDetail: 'content', //翻滚内容
    }
    var articleRun;

    function getMessage() {
        var param = {
            id: TV.GetParam('id'),
        }
        GetDatas('enent1', param, function(err, res) {
                mess = res.data;
                console.log(mess, 'mess')

                $('.content').html(mess.content)
                $('.imgs').attr('src', API_URL.imgURL + mess.img)
                    // $('.').html(mess.);
                $(".titleBox").html("文明随手拍")
                $(".people").html(mess.username)
                $(".datatime").html(mess.dealtime)
            })
            // right.toggleFocus();
    }

    getMessage();


    function direOpt(index, directive) {
        if (directive == "up") { //上
            switch (index) {
                case 2:
                    index = index;
                    break;
            }
            console.log('toptop')

            if (index == 1) { //文章翻滚
                TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
            }
        } else if (directive == "down") { //下
            console.log('downdown', index)
            switch (index) {
                case 2:
                    index = 1;
                    break;
            }
            if (index == 1) { //文章翻滚
                console.log(directive, modelIndex.thisContain, modelIndex.thisDetail, '21212')
                TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
            }
        } else if (directive == "backwards") { //左
            clearInterval(articleRun)

            switch (index) {
                case 1:
                    index = 2;
                    break;
                case 2:
                    index = index;
                    break;
            }

        } else if (directive == "forwards") {
            clearInterval(articleRun)

            switch (index) {
                case 1:
                    index = index;
                    break;
                case 2:
                    index = 1;
                    break;
            }
        }
        console.log(index)
        return index;
    }

    function direEnter(index) {
        console.log(index)
        if (index == 0) {
            // window.location.href = './carrousel.html?id=' + TV.GetParam('id') + '&type=activety';
        } else if (index == 1) { //点单预约
        } else if (index == 2) {
            var params = {
                id: TV.GetParam('id'),
                name: EVM.cookie.getValue('TV_CST_NAME'),
                mobile: EVM.cookie.getValue('TV_CST_MOBILE'),
                // access_token: $.cookie('TV_CST_TOKEN'),
            }
            GetDatas('articleLike', params, function(err, res) {
                resOpt.call(this, res)
            });
        }
    }

    function resOpt(res) {
        // console.log(res)
        if (res.code == 0) {
            TV.PromptMsg("点赞成功");
            $("#likes p").html(res.data.likes)

        } else if (res.code == 10002) {
            TV.userLogin();
            direEnter(index);
        } else {
            TV.PromptMsg(res.message)
        }
    }
</script>
<script type="text/javascript" src="js/index.js"></script>

</html>